"""进度追踪数据模型"""
from pydantic import BaseModel
from typing import Optional, List, Dict, Any
from datetime import datetime


class ProgressOverview(BaseModel):
    """进度概览"""
    user_id: str
    total_study_days: int
    total_study_hours: float
    total_questions: int
    current_streak: int
    longest_streak: int
    accuracy_trend: List[Dict[str, Any]]


class PerformanceMetrics(BaseModel):
    """性能指标"""
    user_id: str
    period: str
    accuracy_rate: float
    average_time_per_question: float
    thinking_quality_score: float
    improvement_rate: float
    daily_stats: List[Dict[str, Any]]


class Achievement(BaseModel):
    """成就"""
    achievement_id: str
    name: str
    description: str
    icon: str
    unlocked_at: Optional[datetime] = None
    progress: Optional[float] = None  # 0.0-1.0


class KnowledgeHeatmap(BaseModel):
    """知识热力图数据"""
    knowledge_area: str
    score: float
    practice_count: int
    last_practiced: Optional[datetime] = None


class ThinkingRadar(BaseModel):
    """思维雷达图数据"""
    logical_reasoning: float
    case_analysis: float
    legal_application: float
    speed: float
    accuracy: float

